<?php $user=$session->read('User');?>

																																		<!--1.头部信息  开始-->
<div class="right_side_operate_area">

	<div class="right_side_title left">
		<h2>
		<?php 
		$companyname=$form->value("Colleage.colleage_name");
		echo $html->link($companyname,"/colleages/showcolleageinfo/".$id);
		?>
		</h2>
		<div class="clear"></div>
	</div>
	
    <div class="right item_add_btn">
    <?php 
    	$id=$form->value('Colleage.id');
    	$str_title=__("Add",true);
		if($id){
			$str_title=__("Edit",true);
		}
		$colleagepath="/colleages/index/";
    	if($user['cid']){
    		$companypath="/colleages/showinfo/".$user['cid'];
    	}
		echo $html->link(__("Cancel",true).$str_title,$colleagepath);
    ?>
    </div>
    
    <div class="clear"></div>
</div>
																																			<!--1.头部信息块  结束-->


																																			<!--2. 主题显示区 开始-->
<div class="right_side_scollbar">
    <div class="detail_info_panel">
  		  <?php echo $form -> create('colleages', array('url' => '/colleages/editcolleageinfo/','enctype'=>'multipart/form-data','type'=> 'post','onsubmit'=>'return checksave()') ); ?>
    	
    	
    	 <!--高校logo 开始-->
       <div class="details_item_line">
             <div class="details_item">
                <div class="form_left_title left">高校logo：</div>
                <div class="form_right_e_input left">
                <?php 
		                if(!empty($logo))
		                {
			                $logoimg=$logo["file_path"];
			                if($logoimg)
			                {
			                	echo $html->image("/".$logoimg,array("width"=>"200px","height"=>"80px")).'<br/>';
			                }
		                }
                ?>
                <input type="file" name="LogoPicture[]" />
                </div>
       		</div>
       	</div>
       <!--高校logo 结束-->
    	
    	<!--2.1 高校名称块  开始-->
    	 <div class="details_item_line">
             <div class="details_item">
                <div class="form_left_title left">高校名称：</div>
                <div class="form_right_e_input left"><?php echo $form->text('Colleage.colleage_name',array("maxlength"=>"100"));?></div>
                <div id='colleagenamemessage' style='display:none;' class="error_message">请输入高校名称</div>
                <?php $cname=$form->value('Colleage.colleage_name');?>
                <div id='cname' style='display:none;'><?php echo $cname ?></div>
                <div style='display:none;'><?php echo $form->text('Colleage.cname',array("value"=>$cname)) ?></div>
            </div>
        </div>
        <!--2.1 高校名称块  结束-->
        
         
        <!--2.3 高校建立时间块 开始-->
        <div class="details_item_line">
			<div class="details_item">
			    <div class="form_left_title left">建立时间：</div>
			    <div class="form_right_e_input form_date_picker left">
			    	<?php echo $form->text('Colleage.found_time',array("maxlength"=>"10","style"=>"width:130px","onfocus"=>"WdatePicker()"));?>
			    </div>
			</div>
	   </div>
        <!--2.3 高校建立时间块 结束-->
        
        <!--2.2 高校地址块 开始-->
        <div class="details_item_line">
        	 <div class="details_item">
	                <div class="form_left_title left">高校地址：</div>
	                <div class="form_right_e_input left"><?php echo $form->text('Colleage.address',array('style'=>'width:250px',"maxlength"=>"100"));?></div>
            </div>
        </div>
        <!--2.2 高校地址块 结束-->
       
        
        <!--2.2 服务方向块  开始-->
        		<div class="details_item_line">
        				 <div class="details_item">
				                <div class="form_left_title left">服务方向：</div>
				                <div class="form_right_e_input left"><?php echo $form->text('Colleage.direction',array('style'=>'width:250px',"maxlength"=>"20"));?></div>
			            </div>
        		</div>
        <!--2.2 服务方向块  结束-->
        
        <!--2.3 联系块  开始-->
        	<div class="details_item_line">
        	
			            <div class="details_item">
			                <div class="form_left_title left">负责人：</div>
			                <div class="form_right_e_input left"><?php echo $form->text('Colleage.contact',array("maxlength"=>"20"));?></div>
			                <div id='colleagecontactmessage' style='display:none;' class="error_message">请输入负责人</div>
			            </div>
			            
			            <div class="details_item">
			                <div class="form_left_title left"><?php __("Tel")?>：</div>
			                <div class="form_right_e_input left"><?php echo $form->text('Colleage.tel',array("maxlength"=>"20"));?></div>
			                <div id='colleagetelmessage' style='display:none;' class="error_message">请输入电话</div>
			            </div>
			            
			            <div class="details_item">
			                <div class="form_left_title left"><?php __("Mail")?>：</div>
			                <div class="form_right_e_input left"><?php echo $form->text('Colleage.email',array("maxlength"=>"50","style"=>"ime-mode:disabled"));?></div>
			                <?php echo $form->text('User.uemail',array("class"=>"txthide","value"=>$form->value('Colleage.email')));?>
			                <div id='colleageemailmessage' style='display:none;' class="error_message">邮箱格式不正确</div>
			            </div>
          </div>
        <!--2.3 联系块  结束-->
        
		 <!--2.4 网站链接块 开始-->
        		<div class="details_item_line">
        				 <div class="details_item">
			                <div class="form_left_title left">高校链接：</div>
			                <div class="form_right_e_input left"><?php echo $form->text('Colleage.link',array("maxlength"=>"50"));?></div>
			            </div>
        	  </div>	
        <!--2.4 网站链接块 结束-->
        
        

 		<!--2.5 高校简介块 开始-->
        <div class="details_item_line">
        	 <div class="details_item">
	                <div class="form_left_title left">高校简介：</div>
	                <div class="form_right_e_input left"><?php echo $form->textarea('Colleage.describe',array('class' => 'form_textarea'));?></div>
            </div>
        </div>
        <!--2.5 高校简介块 结束-->        
        
         <!--2.6 保存按钮块 结束-->
         <div class="details_item_line edit_form_btn">
            <div class="details_item">
            	<div class="form_left_title left"></div>
                <div class="form_add_submit left">
                 	<?php echo $form->submit(__('Save',true), array("div"=>false)); ?>
	                <?php  echo $form->hidden('Colleage.id'); ?>
	                <?php  echo $form->hidden('Colleage.person'); ?>		                		              
	                <?php  echo $form->hidden('Colleage.cgpatents'); ?>
	                <?php  echo $form->hidden('Colleage.equipments'); ?>		                
	                <?php  echo $form->hidden('Colleage.researchcenters'); ?>		               
                </div>
                <div class="form_submit_more left">
                	<input class="click_drop_more_btn" type="button" value="保存并继续添加"/>	                
	                <div class="save_and_add" style="display:none">
	                	<ul>
			                <li><?php echo $form->submit('保存并继续添加人员信息', array("div"=>false,"onclick"=>"saveperson()")) ?></li>
			                <li><?php echo $form->submit('保存并继续添加专利信息', array("div"=>false,"onclick"=>"savepatent()")) ?></li>
			                <li><?php echo $form->submit('保存并继续添加设备信息', array("div"=>false,"onclick"=>"saveequipment()")) ?></li>
			                <li><?php echo $form->submit('保存并继续添加研究信息', array("div"=>false,"onclick"=>"saveresearch()")) ?></li>
			            </ul>
	                </div>	               
	            </div>                     
            </div>
        </div>
         <!--2.6 保存按钮块 结束-->
   
    </div>
 </div>
 <?php echo $this->element('delfileconfirm',array("title"=>"删除提示","message"=>"你确定要删除吗？")) ?>
 <?php echo $javascript->link('project.js');?>
 																																			<!--2.主体显示区 结束-->
 							
 
 																																			<!--3.JavaScript部分 开始-->		
<script>
var webpath=$("#getpath").attr('href');
	$(".click_drop_more_btn").click(function(){
		$(".save_and_add").slideToggle("fast").css("display","block");
	});
	//检验Email的格式是否正确
  $("#ColleageEmail").keyup(function() {  
   	var mail=this.value;
   	var umail=$("#UserUemail").val();
 	checkuserbymail(webpath,mail,umail,"#colleageemailmessage");
  });  
 
  //用于检验当点击提交按钮时用户输入的数据的格式是否正确																												
 function checksave()
{
	var mail=$("#CompanyEmail").val();
	var companytame=$("#CompanyCompanyName").val();
	if($("#ColleageColleageName").val().trim()== '')
	{	
		$("#colleagenamemessage").css('display','block');
		return false;
	}
	else
	{
		$("#colleagenamemessage").css('display','none');
	}
	if($("#ColleageContact").val().trim() == '')
	{
		$("#colleagecontactmessage").css('display','block');
		return false;
	}
	else
	{
		$("#colleagecontactmessage").css('display','none');
	}
	if($("#ColleageTel").val().trim() == '')
	{
		$("#colleagetelmessage").css('display','block');
		return false;
	}
	else
	{
		$("#colleagetelmessage").css('display','none');
	}
	if($("#colleageemailmessage").css('display')=="block")
	{
		return false;
	}
	return true;
}
function saveperson() {	  			
		$("#ColleagePerson").val("1");
		return checksave();		
	}
	
	function saveequipment() {	  			
		$("#ColleageEquipments").val("1");
		return checksave();		
	}

	function savepatent() {	  			
		$("#ColleageCgpatents").val("1");
		return checksave();		
	}	
	function saveresearch() {	  			
		$("#ColleageResearchcenters").val("1");
		return checksave();		
	}	

		
</script>
																																			<!--3.JavaScript部分 结束-->